import { _decorator, Component, Label, Node } from 'cc';
import { BaseComponent } from '../Manager/UIManager/BaseComponent';
import { GAME_POP, GAME_SCENE, GlobalData, SOUND_TYPE } from '../Data/GlobalData';
const { ccclass, property } = _decorator;

@ccclass('PopEnd')
export class PopEnd extends BaseComponent {

    //金币文字
    @property(Label)
    private CoinLabel: Label = null;


    protected OnShow(): void {
        app.gameData.GameOver();
        this.CoinLabel.string = GlobalData.GameCoin.toString();
    }

    /**
     * 再来一次点击
     */
    private AgainClick() {
        app.audioManager.PlayEffect(SOUND_TYPE.Button);
        app.popManager.HidePop(GAME_POP.PopEnd);
        app.uiManager.ShowUI(GAME_SCENE.GameScene);

    }

    /**
     * 回到首页
     */
    private LoginClick() {
        app.audioManager.PlayEffect(SOUND_TYPE.Button);
        app.popManager.HidePop(GAME_POP.PopEnd);
        app.uiManager.ShowUI(GAME_SCENE.LoginScene);
    }
}


